#! /usr/bin/python

from pyglet import window
from pyglet import clock
from pyglet import font

ft = font.load('Arial',28)
fps_text = font.Text(ft, y=10)

win = window.Window()

while not win.has_exit:
    win.dispatch_events()
    win.clear()
    
    clock.tick()
    fps_text.text = ("fps: %d") % (clock.get_fps())
    fps_text.draw()

    win.flip()
